﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common.XmlConfig;

namespace ZWZ.Web.WebAdmin.UCtrs
{
    public partial class CtrQuickView : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Repeater1.DataSource = Config.ConfigAdapter.AdminMenu.Groups[0].Settings;
                Repeater1.DataBind();
            }
        }
        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            ConfigSetting setting = e.Item.DataItem as ConfigSetting;
            Label Lab_Img = e.Item.FindControl("lab_Img") as Label;
            if (setting.Attrs["Style"] != null) { Lab_Img.Attributes["Style"] = setting.Attrs["Style"].Value; }
            HyperLink lnk_Text = e.Item.FindControl("lnk_Text") as HyperLink;
            lnk_Text.Text = setting.Text;
            lnk_Text.NavigateUrl = setting.Value;
            if (setting.Attrs["Target"] != null) lnk_Text.Target = setting.Attrs["Target"].Value;
        }
    }
}